package com.dbManage.entity;

/**
 * ----------------------------------
 * Describe:	Ecaj2.0
 * ----------------------------------
 * Author:	ONLINE.SANEN
 * Date:	2018/05/09
 * Time:	16:42:45
 * ----------------------------------
 */

public class User {
    private int id;

    /**
     * 账号
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 权限:1.超级管理员,2.管理员,3.普通成员
     */
    private int role;
    private String roleStr;

    /**
     * 添加时间戳
     */
    private int time;
    private String date;
    /**
     * 状态:0.正常,1.禁用
     */
    private int status;

    public User() {
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUsername() {
        return username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setRole(int role) {
        this.role = role;
        switch (role) {
            case 1:
                roleStr = "超级管理员";
                break;
            case 2:
                roleStr = "管理员";
                break;
            case 3:
                roleStr = "普通用户";
                break;
        }
    }

    public int getRole() {
        return role;
    }

    public String getRoleStr() {
        return roleStr;
    }

    public void setRoleStr(String roleStr) {
        this.roleStr = roleStr;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public int getTime() {
        return time;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getStatus() {
        return status;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickName='" + nickName + '\'' +
                ", role=" + role +
                ", time=" + time +
                ", status=" + status +
                '}';
    }
}
